package ${package.Entity};

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
* ${table.comment!} 实体类
* @author ${author}
* @date ${date}
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ${entity} implements Serializable {

    private static final long serialVersionUID = 1L;

<#-- list指令 迭代循环 -->
<#list table.fields as field>
   <#if field.propertyName == "id">
    /**
     * ${field.comment}
     */
    @TableId(value = "id", type = IdType.AUTO)
    private ${field.propertyType} ${field.propertyName};

   <#elseif field.propertyName == "createdAt" || field.propertyName == "updatedAt">
    /**
     * ${field.comment}
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private ${field.propertyType} ${field.propertyName};

   <#else>
    /**
     * ${field.comment}
     */
    private ${field.propertyType} ${field.propertyName};

   </#if>
</#list>

}